﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace DawnOfConquest
{
    class Zealot : DawnOfConquest.Unit
    {
        public Zealot(string faction, ContentManager content)
        {
            spriteb = content.Load<Texture2D>("UnitSprites/ZealorBlue");
            spriter = content.Load<Texture2D>("UnitSprites/ZealorRed");
            this.faction = faction;
            name = "Zealot";
            strength = 3;
            dex = 4;
            stamina = 4;
            intel = 5;
            will = 3;
            range = 1;
            actionPoints = 5;
            health = stamina * 5;
            level = 1;
            xp = 0;
        }

        public override int getDefense()
        {
            return dex + will / 2;
        }

        public override int getAttack()
        {
            return dex;
        }

        public override int getDamage()
        {
            return strength + will / 2;
        }

        public override int maxXP()
        {
            return (10 + (90 * level));
        }

        public override void levelUp()
        {
            level++;
            strength++;
            //health += 10;
            if (level % 2 == 0)
                will++;
            if (level % 3 == 0)
            {
                stamina++;
                dex++;
            }
            if (stamina * 5 - health >= 10)
            {
                health += 10;
            }
            else
            {
                health = stamina * 5;
            }
            //100 experience to level 2, increase by an additional 90 experience for each successive level
        }
    }
}
